from pydantic_settings import BaseSettings, SettingsConfigDict
from typing import List, Optional

class Settings(BaseSettings):
    model_config = SettingsConfigDict(
        env_file=".env",
        env_file_encoding='utf-8',
        extra="ignore"
    )

    APP_NAME: str = "flowith-2api"
    APP_VERSION: str = "1.3.0"
    DESCRIPTION: str = "一个将 flowith.net 网页聊天转换为兼容 OpenAI 格式 API 的高性能代理 (会话模拟版)。"

    API_MASTER_KEY: Optional[str] = None
    
    API_REQUEST_TIMEOUT: int = 180
    NGINX_PORT: int = 8088

    # Supabase 配置
    SUPABASE_URL: str = "https://aibdxsebwhalbnugsqel-all.supabase.co"
    SUPABASE_ANON_KEY: str = "sb_publishable_qPCinc8LE8ChpdT7Pf79tQ_eryz5udr"

    DEFAULT_MODEL: str = "flowith-gpt-4.1"
    KNOWN_MODELS: List[str] = [
        "flowith-gpt-4.1", "flowith-gpt-4.1-mini", "flowith-gpt-5-nano",
        "flowith-gpt-5-mini", "flowith-deepseek-chat", "flowith-deepseek-reasoner",
        "flowith-gemini-2.5-flash", "flowith-gpt-oss-120b", "flowith-gpt-oss-20b",
        "flowith-grok-3-mini", "flowith-kimi-k2",
    ]

settings = Settings()
